<template>
  <div>
    <eagle-popup
      title="选择整改部门/人"
      position="bottom"
      :popStyle="{ height: '80%' }"
      v-bind="$attrs"
      v-on="$listeners"
      ref="eaglePopup"
      closeable
    >
      <eagle-list
        ref="eagleList"
        showTab
        allowSearch
        :isSticky="false"
        :tabData="tabData"
        @initActive="_initActive"
        @bindData="bindData"
      >
        <eagle-cell v-for="(item, index) in list" :key="index">
          <div @click="submit(item, index)">
            <div>
              <template v-if="active === 0">
                <div class="f14 mb-10">{{ item.OrgName }}</div>
                <div class="f12">{{ item.OrgFullName }}</div>
              </template>
              <template v-else>
                <div class="f14 mb-10">{{ item.ChnName }}</div>
                <div class="f12">{{ item.OrgFullName }}</div>
              </template>
            </div>
          </div>
        </eagle-cell>
      </eagle-list>
    </eagle-popup>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tabData: [
        {
          title: "部门",
          url: "/UserUser/GetChooseOrgList",
          params: {
            showMyDept: true,
            onlyMyDept: false,
            keywords: "",
            page: 0,
          },
          isPage: false,
        },
        {
          title: "员工",
          url: "/UserUser/GetChooseUserList",
          // url: "/UserUser/GetChooseUserPageData",
          params: {
            accounted: true,
            keywords: "",
            page: 0,
            orgCode:'',
            operateType:'assign',

            // conditions:'[{"DataType":"String","IsTemp":false,"Name":"orgCode","Operator":"\u003d","Value":"BM24072400001"}]'
            // conditions:[{DataType:'String',IsTemp:false,Name:'orgCode',Operator:"\u003d",Value:"BM24072400001"}]
          },
          isPage: false,
        },
      ],
      activeFilter: [
        {
          active: 0,
          filter: false,
        },
        {
          active: 1,
          filter: false,
        },
      ],
      active: 0,
      list: [],
      conditions:''
    };
  },
  created(){
    let OrgCode=this.$store.state.DeptCode
    this.tabData[1].params.orgCode=OrgCode

  },
  methods: {
    _initActive(active) {
      this.active = active;
    },
    bindData(list) {
      console.log(this.tabData)
      this.list = list;
    },
    submit(item, index) {
      this.$emit("callback", this.list[index]);
    },
  },
};
</script>